<?php
require_once 'shopping.php';
class Homepage extends Shopping
{
	function __construct()
	{
		parent::__construct();
		$this->load->model('category');
	    $this->load->model('product');
	    
	}
 	function index()
    {
    	
    	$this->temp['categorys']=$this->category->fetch();
    	$this->temp['products']=$this->product->fetch();
    	$this->temp['view']='template/content';
    	$this->load->view('home/main',$this->temp);
    	
    }
    function backend()
    {
    	
    	$this->temp['data']['categorys']=$this->category->fetch();
    	$this->temp['data']['products']=$this->product->fetch();
    	$this->temp['view']='backend/backendcontent';
    	$this->load->view('backend/main',$this->temp);
    }
    function add_product()
    {
    	
    	$this->temp['data']['categorys']=$this->category->load_all();
    	$this->temp['view']='backend/add_product';
    	$this->load->view('backend/main',$this->temp);
    }
}
?>